﻿
using System.Text;
using System;
namespace BF3StatsNetApi.BLL
{
    /// <summary>
    /// This class contains a set of properties representing the information stored for a giving player of Battlefield 3.
    /// </summary>
    public class Player
    {
        public string name { get; set; }
        public string language { get; set; }
        public string country { get; set; }
        public string country_name { get; set; }
        public string country_img { get; set; }
        private DateTime? _date_insert;
        public object date_insert { 
            get { return _date_insert; } 
            set {
                _date_insert = Utility.UnixTimeStampToDateTime(value);
            } 
        }
        private DateTime? _date_update;
        public object date_update { 
            get { return _date_update; } 
            set {
                _date_update = Utility.UnixTimeStampToDateTime(value);
            } 
        }
        public Stat stats { get; set; }
        public string status { get; set; }
        public string error { get; set; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("Name: " + name);
            sb.AppendLine("Country: " + country_name);
            sb.AppendLine("Date created: " + date_insert);
            sb.AppendLine("Date updated: " + date_update);

            return sb.ToString();
        }

    }
}
